package org.go.expcetion;

import org.go.trigger.Trigger;

public class ObjectAlreadyExistsException extends JobPersistenceException {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3758104789197121053L;

	public ObjectAlreadyExistsException(String string) {
		super(string);
	}

	/**
	 * <p>
	 * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a
	 * message using the name/group from the given <code>Trigger</code>.
	 * </p>
	 * 
	 * <p>
	 * The message will read: <BR>"Unable to store Trigger with name: '__' and
	 * group: '__', because one already exists with this identification."
	 * </p>
	 */
	public ObjectAlreadyExistsException(Trigger offendingTrigger) {
		super("Unable to store Trigger with name: '" + offendingTrigger.getKey().getName() + "' and group: '" + offendingTrigger.getKey().getGroup() + "', because one already exists with this identification.");
	}
}
